package cn.ithers.blog.dao;

import cn.ithers.blog.pojo.Image;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @Author: zhanghuan
 * @date: 2020/10/4 10:57
 * @description:
 */
public interface ImageDao extends JpaRepository<Image,String>, JpaSpecificationExecutor<Image> {
    @Modifying
    @Query(nativeQuery = true,value = "update tb_images set state = 0 where id = ?" )
    int deleteImageByUpdateState(String imageId);
}
